<?php

class gallery_model extends FlexiGrid_Model {

    function __construct()
    {
        parent::__construct();
        
    }
    function get($ID=""){
        $where=array("ID"=>$ID,"Delete"=>NULL);
        $query=$this->db->get_where('tbl_gallery', $where); 
        return $query->result();
    }
    function getByAlias($Alias=""){
        $where=array("Alias"=>$Alias,"Delete"=>NULL);
        $query=$this->db->get_where('tbl_gallery', $where); 
        return $query->result();
    }
    function gets(){
        $query=$this->db
                ->from('_gallery')
                ->where(array(
                    "_delete"=>NULL,
                    "_status"=>"true",
                    "_id <>"=>"AD41F1044CBB7668BA3764D259458259"
                ))
                ->order_by("_insert","DESC")
                ->get(); 
        return $query->result();
    }
    function getdetail($_id,$num){
        $query=$this->db
                ->where(array(
                    "_galleryid"=>$_id,
                    "_delete"=>null
                ))
                ->order_by("_insert","DESC")
                ->get('_gallery_detail',$num); 
        return $query->result();
    }
    
}
?>
